package com.jysz.certificate.persistence.enums;
/**
 * 合格证状态
 * @author zhouhang
 */
public enum CertificationType {
	 UNFINISHED("暂存",0),ONORDER("在途",1),INSTOCK("在库",2),APPROVED ("补录待审核",3), FILL("已退回",4), RELEASEED("已释放",5), RENEWPASS("换证审核通过",6), RENEWOUT("已换出",7);
    //名称
    private String name;
    //索引
    private int index;   
    private CertificationType(String name, int index) {   
        this.name = name;   
        this.index = index;   
    }   
    
    //根据索引获得名称
    public static String getName(int index) {   
        for (CertificationType w : CertificationType.values()) {   
            if (w.getIndex() == index) {   
                return w.name;   
            }   
        }   
        return null;   
    }
    
  //根据索引获得枚举
    public static CertificationType index(int index) {   
        for (CertificationType w : CertificationType.values()) {   
            if (w.getIndex() == index) {   
                return w;   
            }   
        }   
        return null;   
    }
    
    public String getName() {   
        return name;   
    }   
    public void setName(String name) {   
        this.name = name;   
    }   
    public int getIndex() {   
        return index;   
    }   
    public void setIndex(int index) {   
        this.index = index;   
    }   
    
}
